package com.ucode.springboot.starter.security.entity;

import java.io.Serializable;
import java.util.List;
import java.util.Set;

/**
 * 安全校验用户信息
 * @author: liliang
 * @date: 2019年12月20日 下午2:18:18
 */
@SuppressWarnings("serial")
public class UcodeUser implements Serializable{

    /**
     * 用户Id
     */
    private String userId;
    /**
     * 用户名
     */
    private String username;
    /**
     * 用户密码
     */
    private String password;
    /**
     * 账号是否未过期
     */
    private boolean accountNonExpired = true;
    /**
     * 账号是否未锁定
     */
    private boolean accountNonLocked = true;
    /**
     * 密码是否未过期
     */
    private boolean credentialsNonExpired = true;
    /**
     * 用户角色权限集合,存储特殊角色以及资源权限
     */
    private Set<String> roles;
    /**
     * 用户security权限
     */
    private List<UcodeGrantedAuthority> authoritys;
    
    public UcodeUser() {
        super();
    }
    
    public UcodeUser(String userId, String username, String password, boolean accountNonExpired,
            boolean accountNonLocked, boolean credentialsNonExpired, Set<String> roles,List<UcodeGrantedAuthority> authoritys) {
        super();
        this.userId = userId;
        this.username = username;
        this.password = password;
        this.accountNonExpired = accountNonExpired;
        this.accountNonLocked = accountNonLocked;
        this.credentialsNonExpired = credentialsNonExpired;
        this.roles = roles;
        this.authoritys = authoritys;
    }
    
    public String getUserId() {
        return userId;
    }
    public void setUserId(String userId) {
        this.userId = userId;
    }
    public String getUsername() {
        return username;
    }
    public void setUsername(String username) {
        this.username = username;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    public boolean isAccountNonExpired() {
        return accountNonExpired;
    }
    public void setAccountNonExpired(boolean accountNonExpired) {
        this.accountNonExpired = accountNonExpired;
    }
    public boolean isAccountNonLocked() {
        return accountNonLocked;
    }
    public void setAccountNonLocked(boolean accountNonLocked) {
        this.accountNonLocked = accountNonLocked;
    }
    public boolean isCredentialsNonExpired() {
        return credentialsNonExpired;
    }
    public void setCredentialsNonExpired(boolean credentialsNonExpired) {
        this.credentialsNonExpired = credentialsNonExpired;
    }
    public Set<String> getRoles() {
        return roles;
    }
    public void setRoles(Set<String> roles) {
        this.roles = roles;
    }
    public List<UcodeGrantedAuthority> getAuthoritys() {
        return authoritys;
    }
    public void setAuthoritys(List<UcodeGrantedAuthority> authoritys) {
        this.authoritys = authoritys;
    }
}
